package com.ln.dm1108.demo01;

/**
 * @author Ln
 * @version 终极版
 * @date 2022/11/8 15:40
 */
public class Singleton {
    private volatile static Singleton singleton;

    private Singleton(){}

    public static Singleton getInstance(){
        if (singleton==null){
            synchronized (Singleton.class){
                if (singleton==null){
                    singleton=new Singleton();
                }
            }
        }
        return singleton;
    }
}
